package aex.service;



import java.io.Serializable;
import java.util.LinkedHashMap;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import aex.dao.AttentionUserDao;
import aex.domain.AttentionUser;



@Transactional(readOnly = false)
@Service(AttentionUserService.SERVICE_NAME)

public class AttentionUserService  {

	
	public static final String SERVICE_NAME="aex.service.AttentionUserService";
	/**
	 * 以注解的形式让spring为我们注入dao的实现类
	 */
	@Resource(name = AttentionUserDao.SERVICE_NAME)
	public AttentionUserDao dao;
	
	public AttentionUserService() {
		
	}
	public AttentionUser findByID(Serializable id) {
		return dao.findObjectByID(Integer.parseInt(id+""));
	}
	public void deleteById(Serializable id) {
		dao.deleteObjectByIDs(Integer.parseInt(id+""));
	}
	public void save(AttentionUser obj) {
		dao.save(obj);
	}
	public void update(AttentionUser obj) {
		dao.merge(obj);
	}
	public void deleteByUser(Integer me, Integer her) {
		dao.execHql(" delete from  MessageBoard where puserByMbPued="+her+" and puserByMbPu="+me);
		
	}
	
	
	
}
